package game.data.recipeskill;

import game.conflict.ConflictModel;
import game.conflict.Data;
import game.element.Material;
import game.element.NormalSkill;

public class sanweiguiyi extends NormalSkill{
	int op=-1;
	int num=0;
	boolean x=false;
	@Override
	public boolean check(ConflictModel model) {
		if(op==-1) op=model.getTimes();
		if(model.getGamestate()==Data.combine && (model.getTimes()-op)%2==0){
			x=false;
			return true;
		}
		
		return false;
	}
	
	public void doing(ConflictModel model) {
		if(!x){
			model.setNeed(true);
			model.setState(Data.now_asea);
			model.setNum_need(0);
			num=0;
			x=true;
		}else
		if(x){
			if(!model.isNeed()){
				for(int i=0;i<num;i++){
					model.getone();
				}
			}else{				
				model.getNow_player().getHand().remove(model.getaSeasoning());
				num++;
			}
		}
	};
	
	public boolean addMaterial(Material material) {
		return super.addMaterial(material);
	};

}
